package com.yanqu.road.server.manager.config;

import com.yanqu.road.entity.config.patrons.PatronsInfo;
import com.yanqu.road.logic.bussiness.config.PatronsBussiness;
import com.yanqu.road.server.TempMgr;

import java.util.Map;

/**
 * @author ：zfr
 * @date ：2021/7/12 10:00
 */
public class PatronsMgr extends TempMgr {
    private static Map<Integer, PatronsInfo> patronsInfoMap;

    @Override
    public boolean reloadConfig() throws Exception {
        patronsInfoMap = PatronsBussiness.getPatronsInfoMap();
        return true;
    }

    @Override
    public boolean reloadData() throws Exception {
        return true;
    }

    public static Map<Integer, PatronsInfo> getPatronsInfoMap() {
        return patronsInfoMap;
    }

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    public static PatronsInfo getPatronsInfo(int patronsId) {
        return patronsInfoMap.get(patronsId);
    }

    @Override
    public boolean stop() {
        return false;
    }
}
